package com.cn.common;

import java.net.InetAddress;
import java.net.InetSocketAddress;

public class RemoteHandler {

    public static InetSocketAddress string2SocketAddress(String addr) {
        String[] addrs = addr.split(":");
        InetSocketAddress s = new InetSocketAddress(addrs[0], Integer.valueOf(addrs[1]));
        return s;
    }

    public static void main(String[] args) {
        String addr = "127.0.0.1:2180";
        System.out.println(string2SocketAddress(addr).getPort());
    }

}
